<?

echo "MODIFY MODE :" 	.$_SESSION["modify_mode"]. "<br/>\n";

if($_SESSION["modify_mode"] == "Y"){

	$status_of_write="Modify";
}else{

	$status_of_write="Confirm";
}

require("entry_header_html.php");		
//query and get the table header

echo  "<table label='entryDetail' border='1' class='dedeq'>\n".
      "<th> No     </th>\n".
      "<th> Cat    </th>\n".
      "<th> Grp    </th>\n".
      "<th> Model  </th>\n".
      //"<th> ID     </th>\n".
      "<th> Unit   </th>\n".
      "<th> Qty    </th>\n".
      "<th> Cvt    </th>\n".
      "<th> Qty    </th>\n".
      "<th> Price  </th>\n".
      "<th> #      </th>\n";

for($iRow = 0; $iRow < $_SESSION["init_num"]; $iRow++){      
  
  echo  "<tr>\n".
          "<td > ".($iRow + 1)." </td>\n".
          
          "<td > ".formInput("categoryEnt[".$iRow."]",
                             $_POST["categoryEnt"][$iRow],
                             $propNo . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("groupEnt[".$iRow."]",
                             $_POST["groupEnt"][$iRow],
                             $propNo . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("modelEnt[".$iRow."]",
                             $_POST["modelEnt"][$iRow],
                             $propNo . _MODE_READONLY)." </td>\n".
          
          formHidden("modelIdEnt[".$iRow."]",
                     $_POST["modelIdEnt"][$iRow],
                     $propNo . _MODE_READONLY).
                                           
          "<td > ".formInput("unitEnt[".$iRow."]",
                             $_POST["unitEnt"][$iRow],
                             $propNo . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("qtyEnt[".$iRow."]",
                             $_POST["qtyEnt"][$iRow],
                             $numStyle . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("cvtEnt[".$iRow."]",
                             $_POST["cvtEnt"][$iRow],
                             $propNo . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("cvtQtyEnt[".$iRow."]",
                             $_POST["cvtQtyEnt"][$iRow],
                             $numStyle . _MODE_READONLY)." </td>\n".
                                           
          "<td > ".formInput("priceEnt[".$iRow."]",
                             $_POST["priceEnt"][$iRow],
                             $numStyle . _MODE_READONLY)." </td>\n".
          
          "<td > ".formInput("hrzTotEnt[".$iRow."]",
                             $_POST["hrzTotEnt"][$iRow],
                             $numStyle . _MODE_READONLY)." </td>\n".
                                                                            
        "</tr>\n";
}

echo  "<tr>\n".
      "<td colspan='5' align='right'><b> TOTAL </b> </td>\n".
      "<td> ".formInput("totQtyEnt",
                        $_POST["totQtyEnt"],
                        $numStyle . _MODE_READONLY)." </td>\n".
                   
      "<td>  </td>\n".
      
      "<td> ".formInput("totCvtQtyEnt",
                        $_POST["totCvtQtyEnt"],
                        $numStyle . _MODE_READONLY)." </td>\n".
      
      "<td>  </td>\n".
                        
      "<td> ".formInput("grandTotEnt",
                        $_POST["grandTotEnt"],
                        $numStyle . _MODE_READONLY)." </td>\n".
                        
    "</tr>\n";

echo 	"</table><br/><br/>\n".
        formInputButton("Save",
                        "confirm",
                        "Confirm",
                        $stlButton).
  			formInputButton("Back",
                        "back",
                        "Back",
                        $stlButton).
  		"</form>	\n";

?>